home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7865 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: anvil.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Best way to insert in file
  5. Date: 27 Feb 1996 15:59:51 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4h05tnINNic5@anvil.ugrad.cs.ubc.ca>
  8. References: <4gldjl$cck@news.fwi.com> <1996Feb25.164738.7783@zcon.com> <4gqvppINNh86@keats.ugrad.cs.ubc.ca> <31335B38.7306EBA@eiffel.com>
  9. NNTP-Posting-Host: anvil.ugrad.cs.ubc.ca
  10.  
  11. In article <31335B38.7306EBA@eiffel.com>,
  12. Guus Leeuw jr. <guusl@eiffel.com> wrote:
  13.  >Kazimir Kylheku wrote:
  14.  >> 
  15.  >[snip snip]
  16.  >>  >19.14:  How can I insert or delete a line (or record) in the middle of a
  17.  >>  >        file?
  18.  >>  >
  19.  >>  >If you do not have the comp.lang.c FAQ, it can be found at rtfm.mit.edu
  20.  >>  >in an appropriate subdirectory of /pub/usenet/.
  21.  >> 
  22.  >> Of course, the real answer is to avoid writing a C program, and use a filter
  23.  >> utility called "sed". I have used this little program to edit the 200,000+th
  24.  >> line of a 400,000 line text file. Writing C code to do the same thing is
  25.  >> redundant, considering that sed can do all kinds of things to a file other than
  26.  >> just insert and delete lines.
  27.  >
  28.  >What makes you think that person is using UNIX?
  29.  
  30. What makes you think you can't get ``sed'' for DOS? I have used grep under DOS,
  31. make, vi, gzip, gcc, gas, flex, bison and even GNU Emacs running in a 32-bit
  32. extender.  Indeed, with the limited memory management resources on this
  33. platform, a sed-like program is the only way to edit large files. You can't
  34. get away with loading a 40MB file into vi, and count on a 64MB swap partition
  35. to absorb the shock.
  36. -- 
  37.  
  38.